package org.gikolet.ch2.data;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Res {
	private String name;
	private String mail;
	private String dateString;
	private String id;
	private String be;
	private String body;

	private List<Span> bodySpans;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getMail() {
		return mail;
	}

	public void setMail(String mail) {
		this.mail = mail;
	}

	public String getDateString() {
		return dateString;
	}

	public void setDateString(String dateString) {
		this.dateString = dateString;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getBe() {
		return be;
	}

	public void setBe(String be) {
		this.be = be;
	}

	public String getBody() {
		return body;
	}

	public void setBody(String body) {
		this.body = body;
	}

	public List<Span> getBodySpan() {
		if (this.bodySpans == null) {
			return Collections.emptyList();
		}
		return this.bodySpans;
	}

	public void addBodySpan(Span span) {
		if (this.bodySpans == null) {
			this.bodySpans = new ArrayList<Span>();
		}
		this.bodySpans.add(span);
	}

	public static class Span {

		public enum SpanType {
			Link, InnerLink
		};

		public final SpanType spanType;
		public final int start;
		public final int end;

		public Span(SpanType spanType, int start, int end) {
			this.spanType = spanType;
			this.start = start;
			this.end = end;
		}
	}
}
